import request from "../index.js";

// 获取商家默认配置
export const getSellerConfigApi = (data, action = '') => {
	let url = action ? `/seller/config?action=save` : '/seller/config'
	return request({
		url: url,
		method: 'post',
		data
	})
}
// 获取特价商品分类列表
export const getSpecialsCategoryListApi = (data) => {
	return request({
		url: `/special/cate_list`,
		data
	})
}
// 设置特价商品分类指定字段值
export const cateUpdateApi = (data) => {
	return request({
		url: `/special/cate_update`,
		method: 'post',
		data
	})
}
// 特价商品分类新增/编辑
export const submitCateTempApi = (data) => {
	return request({
		url: '/special/cate_temp?action=save',
		method: 'post',
		data
	})
}
// 获取特价商品
export const getSpecialsGoodListApi = (data) => {
	return request({
		url: '/special/goods_list',
		data
	})
}
// 新增/编辑特价商品
export const specialsGoodAddOrEditApi = (data) => {
	return request({
		url: '/special/goods_temp?action=save',
		method: 'post',
		data
	})
}
// 设置特价商品指定字段值
export const specialGoodsUpdateApi = (data) => {
	return request({
		url: `/special/goods_update`,
		method: 'post',
		data
	})
}
// 调整特价商品库存
export const changeGoodsStockApi = (data) => {
	return request({
		url: `/special/goods_stock`,
		method: 'post',
		data
	})
}
// 获取调整特价商品库存记录
export const getChangeStockLogsApi = (data) => {
	return request({
		url: `/special/stock_log`,
		data
	})
}
// 获取代金券订单记录
export const getVoucherOrderListApi = (data) => {
	return request({
		url: `/trade/voucher_list`,
		data
	})
}
// 获取套餐券订单记录
export const getComboOrderListApi = (data) => {
	return request({
		url: `/trade/combo_list`,
		data
	})
}
// 获取配送订单记录
export const getDeliveryOrderListApi = (data) => {
	return request({
		url: `/trade/delivery_list`,
		data
	})
}
// 获取配送订单记录详情
export const getDeliveryOrderDetailApi = (id) => {
	return request({
		url: `/trade/delivery_item`,
		data: {
			id
		}
	})
}
// 获取特价商品订单记录
export const getSpecialOrderListApi = (data) => {
	return request({
		url: `/trade/special_list`,
		data
	})
}
// 获取特价订单记录详情
export const getSpecialOrderDetailApi = (id) => {
	return request({
		url: `/trade/special_item`,
		data: {
			id
		}
	})
}
// 特价商品发货/收货
export const specialDeliveryApi = (id, type = 0) => {
	let url = type == 0 ? '/trade/special_take' : '/trade/special_receive'
	return request({
		url: url,
		method: 'post',
		data: {
			id
		}
	})
}
// 获取结算申请列表
export const getFinanceListApi = (data) => {
	return request({
		url: `/finance/cash_list`,
		data
	})
}
// 结算申请审核
export const applyReviewApi = (data) => {
	return request({
		url: `/finance/cash_review`,
		method: 'post',
		data
	})
}
// 获取退款申请列表
export const getRefundListApi = (data) => {
	return request({
		url: `/finance/refund_list`,
		data
	})
}
// 退款申请改价
export const refundEditPriceApi = (data) => {
	return request({
		url: `/finance/refund_price`,
		method: 'post',
		data
	})
}
// 退款申请审核
export const applyRefundReviewApi = (data) => {
	return request({
		url: `/finance/refund_review`,
		method: 'post',
		data
	})
}
// 获取系统账单
export const getSysFinanceListApi = (data) => {
	return request({
		url: `/finance/system_bill`,
		data
	})
}
// 获取特价账单
export const getSpecialBillListApi = (data) => {
	return request({
		url: `/finance/special_bill`,
		data
	})
}
// 获取微信转账记录
export const getTransferMoneyListApi = (data) => {
	return request({
		url: `/finance/transfer`,
		data
	})
}